<template>
  <div
    class="item1"
    v-for="(item, index) in list"
    :key="index"
    @click="strike(item.id)"
  >
    <van-image round width="10rem" height="10rem" :src="item.avatar_url" />
    <div>
      {{ item.nickname }}
      起送费￥{{ item.start_price }} <van-rate v-model="value" />
    </div>
    
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      value: 4,
    };
  },
  methods: {
    // 获取所有商家
    submit: function () {
      this.myaxios(this.weburl + "shops/shopsinfo/", "get")
        .then((data) => {
          console.log("121211", data);
          this.list = data.data;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 跳转到商家分类页面
    strike: function (id) {
      // alert(id);
      this.$router.push({ path: "/shopsgood", query: { id: id } });
    },
  },
  created() {
    this.submit();
  },
};
</script>

<style>
.item1 {
  width: 70%;
  border: 1px solid white;
  padding: 20px;
}
</style>